package com.tuda.common.enums;

/**
 * 信息编号相关
 */
public enum SmsEnum {

    BING_PHONE(0, "SMS_462225027", "您的验证码为：%s，该验证码5分钟内有效，请勿泄露于他人。"),//用户绑定手机号

    ;

    public static String sign = "途达运输";

    private Integer id;//EnumVerificationType
    private String code;
    private String content;

    SmsEnum(Integer id, String code, String content) {
        this.id = id;
        this.code = code;
        this.content = content;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public static String getContentByCode(String code) {
        SmsEnum[] enums = SmsEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getCode().equals(code)) {
                return enums[i].getContent();
            }
        }
        return "";
    }

    public static String getCodeById(Integer id) {
        SmsEnum[] enums = SmsEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getId().equals(id)) {
                return enums[i].getCode();
            }
        }
        return "";
    }

    public static SmsEnum getById(Integer id) {
        SmsEnum[] enums = SmsEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getId().equals(id)) {
                return enums[i];
            }
        }
        return null;
    }
}
